package com.isoft.entity;

import jakarta.xml.bind.annotation.*;
import lombok.Data;

@Data
@XmlRootElement(name = "MSG")
@XmlAccessorType(XmlAccessType.FIELD)
public class DfmeFrttEntity {
    @XmlElement(name = "META", required = true)
    private Meta meta;

    @XmlElement(name = "DFLT", required = true)
    private Dflt dflt;

    // 用于接收自增主键
    private Long msgId;
    private Long routeId;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Meta {
        @XmlElement(name = "SNDR", required = true)
        private String sender;

        @XmlElement(name = "RCVR", required = false)
        private String receiver;

        @XmlElement(name = "SEQN", required = true)
        private Long sequenceNumber;

        @XmlElement(name = "DDTM", required = true)
        private String dateTime;

        @XmlElement(name = "TYPE", required = true)
        private String type;

        @XmlElement(name = "STYP", required = true)
        private String subType;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Dflt {
        @XmlElement(name = "FLID", required = true)
        private Long flightId;

        @XmlElement(name = "FFID", required = true)
        private String flightFileId;

        @XmlElement(name = "FIDE", required = true)
        private String flightIdentifier;

        @XmlElement(name = "FRTT", required = true)
        private String scheduledTime;

        @XmlElement(name = "FRLT", required = true)
        private String latestTime;
    }

    public Dflt getDflt() { return dflt; }
    public Meta getMeta() { return meta; }
    public Long getMsgId() { return msgId; }
    public Long getRouteId() { return routeId; }
}